<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title><?php echo C("SITE_NAME");?>管理后台</title>
<link rel="shortcut icon" href=" /favicon.ico" />
<link rel="stylesheet" href="/Static/admin/css/component-min.css">
<link rel="stylesheet" href="/Static/admin/css/home.2015.05.22-09.32.css">
<link rel="stylesheet" href="/Static/admin/icon/iconfont.css">
<!--弹窗-->
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script src="/Static/admin/js/layer-2.x/layer.js?v=1.9.0"></script>
<script src="/Static/admin/js/common.js"></script>
<script>
	var UPYUN_DOMAIN = '<?php echo C("UPYUN_DOMAIN");?>';
</script>
</head>
<body class="cp-bodybox">
<!--[if lt IE 9]>
<div class="alert alert-danger disable-del txtCenter" id="tipLowIEVer">
    <h4>系统检测到您使用的浏览器版本过低，为达到更好的体验效果请升级您的浏览器，我们为您推荐：</h4>
    <p>
        <a href="http://www.firefox.com.cn/download/" target="_blank">Firefox浏览器</a>
        <a href="http://www.maxthon.cn/" target="_blank">遨游浏览器</a>
        <a href="http://se.360.cn/" target="_blank">360浏览器</a>
    </p>
</div>
<![endif]-->
<style>
.header-nav-list a {
  display: block;
  padding: 0 10px;
  min-width: 70px;
  line-height: 53px;
  font-size: 14px;
  text-align: center;
  font-weight: 700;
}
</style>

<div class="header">
    <div class="inner clearfix">
        <div class="fl">
            <a href="/" class="header-logo">
                <img
                    src="<?php echo C('UPYUN_DOMAIN'); echo C('SITE_TOPLOGO2');?>"
                    onerror="javascript:this.src='/Static/admin/images/error.png';"
                    ></a>
        </div>
        <!-- end logo -->

        <div class="header-nav fl">
            <ul class="header-nav-list clearfix">
                <!--<li class="fl <?php echo ($controller == 'index')?'active':'';?>"><a href="/admin">首页</a></li>-->
                <?php foreach($MENU as $k=>$v){?>
                <li class="fl <?php echo ($controller == $v['controller'])?'active':'';?>">
                    <a href="<?php echo $v['url'];?>"><?php echo $v['title'];?></a>
                </li>
                <?php } ?>
            </ul>
        </div>
        <!-- end header-nav -->

        <div class="fr">
            <ul class="header-ctrl clearfix">
                <li class="header-ctrl-item fl"><a href="/admin/login/logout">退出</a></li>
            </ul>
        </div>

        <span class="account_inbox_switch fr"></span>
        <span class="header-welcome fr">
            <a href="javasecript:;" class="tips" data-trigger="hover" data-placement="top"><?php echo $admininfo['username'];?></a>
        </span>

    </div>
</div>
<!-- end header -->
	<div class="container">
		<div class="inner clearfix">
	<div class="content-left fl">
    <?php foreach($SUBMENU as $subkey=>$sub){ ?>
    <dl class="left-menu shop_8">
        <dt>
            <i class="icon-menu home"></i> <span id="shop_0" data-id="0"><?=$sub['title']?></span>
        </dt>
        <?php foreach($sub['menu'] as $menu){ ?>
        <dd class="<?php echo ($action == $menu["action"])?'active':'';?>">
            <a href="<?=$menu['url']?>"><?=$menu['title']?></a>
        </dd>
        <?php } ?>
    </dl>
    <?php } ?>
</div>
<link rel="stylesheet" href="/Static/admin/uploader/uploader-image.css">
<script src="/Static/admin/uploader/Q.Uploader.all.js"></script>
<script src="/Static/mobile/js/areadata.js"></script>
<script src="/Static/mobile/js/myarea.js"></script>
<script src="/Static/mobile/js/expressdata.js"></script>
<div class="content-right fl">
    <h1 class="content-right-title">编辑用户信息</h1>
    <form id="form" aciton="/admin/member/edituserajax/?edit_uid=<?php echo get('edit_uid');?>" method="post" id="add" onsubmit="return false">
        <div class="panel-single panel-single-light mgt20">
            <?php if($action=='edituser') { ?>
            <div class="formitems">
                <label class="fi-name">微信头像：</label>
                <div class="form-controls">
                    <img src="<?php echo $userinfo['headimgurl'];?>" width="100">
                </div>
            </div>
            <div class="formitems">
                <label class="fi-name">微信昵称：</label>
                <div class="form-controls">
                    <?php echo $userinfo['nickname'];?>
                </div>
            </div>
            <div class="formitems">
                <label class="fi-name">用户ID：</label>
                <div class="form-controls">
                    <?php echo $userinfo['uid'];?>
                    <input type="hidden" name="uid" value="<?php echo $userinfo['uid'];?>">
                </div>
            </div>
            <?php } ?>
            <div class="formitems">
                <label class="fi-name">真实姓名：*</label>
                <div class="form-controls">
                    <input type="text" class="input xxlarge" name="realname" value="<?php echo $userinfo['realname'];?>" maxlength="20">
                    <span class="fi-help-text">用户的真实姓名</span>
                </div>
            </div>
            
            <div class="formitems">
                <label class="fi-name">用户手机号：*</label>
                <div class="form-controls">
                    <input type="text" class="input xxlarge" name="mobile" value="<?php echo $userinfo['mobile'];?>" maxlength="11">
                    <span class="fi-help-text">用户的手机号码</span>
                </div>
            </div>
            <div class="formitems">
                <label class="fi-name">用户微信号：</label>
                <div class="form-controls">
                    <input type="text" class="input xxlarge" name="wechat_id" value="<?php echo $userinfo['wechat_id'];?>" maxlength="20">
                    <span class="fi-help-text">用户的微信号</span>
                </div>
            </div>
            
            <div class="formitems">
                <label class="fi-name">用户身份证号：</label>
                <div class="form-controls">
                    <input type="text" class="input xxlarge" name="idcard" value="<?php echo $userinfo['idcard'];?>" maxlength="18">
                    <span class="fi-help-text">用户的身份证号</span>
                </div>
            </div>
            
            <div class="formitems">
                <label class="fi-name">用户保证金：</label>
                <div class="form-controls">
                    <input type="text" class="input large" name="bzj_money" value="<?php echo $userinfo['bzj_money'];?>" maxlength="20">
                    <span class="fi-help-text">用户保证金,如果设置为0，用户将无法登陆系统</span>
                </div>
            </div>
            
            <div class="formitems">
                <label class="fi-name">用户培训费：</label>
                <div class="form-controls">
                    <input type="text" class="input large" name="pxf_money" value="<?php echo $userinfo['pxf_money'];?>" maxlength="20">
                    <span class="fi-help-text">用户培训费</span>
                </div>
            </div>

            <div class="formitems" >
                <label class="fi-name">用户等级：</label>
                <div class="form-controls">

                    <select name="grade_id" class="select samll newselect">
                        <?php foreach($grade_arr as $k=>$v){?>
                        <option value="<?php echo $k;?>" <?php echo ($userinfo['grade_id']==$k) ? "selected":'';?> ><?php echo $v;?></option>
                        <?php } ?>
                    </select>
                    <span class="fi-help-text" style="color:red;">请慎重更改 <a target="_blank" href="/admin/member/grade">查看等级说明</a></span>
                </div>
            </div>

            <div class="formitems">
                <label class="fi-name">用户上级id：</label>
                <div class="form-controls">
                    <input type="text" id="refer_uid"  class="input mini" name="refer_uid" value="<?php echo $userinfo['refer_uid'];?>" >
                    <span class="fi-help-text" style="color:red;">请填写用户的上级用户id, 请慎重更改</span>
                </div>
            </div>
        </div>
    

        <div class="panel-single panel-single-light mgt20 txtCenter">
            <a href="javascript:tijiao();" class="btn btn-primary j-add">我确认无误并提交修改</a>
        </div>

    </form>

</div>
<script>

    function tijiao() {
        var title = "以上数据非常重要,你确定要继续提交新数据吗?";

        layer.confirm(title, {
            btn: ['确定', '我再想想'] //按钮
        }, function () {
            weSubmit();
        }, function () {
            layer.msg('你取消了提交', {icon: 7});
        });
    }


    function weSubmit() {

        $.ajax({
            url: '/admin/member/edituserajax?edit_uid=<?php echo get("edit_uid");?>',
            type: "POST",
            data: $('#form').serialize(),
            dataType: 'json',
            async: false,
            success: function (data) {
                layer.closeAll('loading');//关闭正在加载
                if (data.ret == 0) {
                    // 成功
                    var messagetype = 1;
                } else {
                    // 失败
                    var messagetype = 2;
                }
                if (data.url) {
                    // 如果有跳转地址
                    layer.msg(data.msg, {icon: messagetype}, function () {
                        window.location.href = data.url;//跳转
                    });

                } else {
                    layer.msg(data.msg, {icon: messagetype});
                }
            },
            beforeSend: function () {
                layer.load();//正在加载
            },
            error: function () {
                layer.closeAll('loading');//关闭正在加载
                layer.msg("网络错误,请重试", {icon: 2});
            }

        });
    }
    city.getcity('province','city','county','<?php echo $userinfo["user_province"];?>','<?php echo $userinfo["user_city"];?>','<?php echo $userinfo["user_county"];?>',1);
    new Q.Uploader({
        url:"/admin/member/upload",
        target: document.getElementById('upload'),    //上传按钮
        multiple: false,
        on: {
            complete: function(res) {
                var json = res.json;
                $('#uploadlist .displayimg').attr('src',"<?php echo C('UPYUN_DOMAIN');?>"+json.data);
                $('#qrcode').val(json.data);
            }
        }
    });
   
</script>
		</div>
	</div>
<!--gonggao-->
<div class="footer">&copy; <?php echo date("Y");?> <?php echo C("SITE_NAME");?> , Inc. All rights reserved.</div>
<a href="#" id="j-gotop" class="gotop" title="回到顶部" style="right:45px; display: inline;"></a>
<script type="text/javascript">
$(function(){
    var height1=$(".content-right").height();
    var height2=$(".content-left").height();
    if(parseInt(height1) < parseInt(height2)){
        $(".content-right").css({'min-height': height2});
    }
    $(window).scroll(function() {
		$(this).scrollTop() >= 150 ? $("#j-gotop").fadeIn(300) : $("#j-gotop").fadeOut(300)
	});
});
</script>
</body>
</html>